package cn.edu360t.config

import java.util.Properties

import com.typesafe.config.{Config, ConfigFactory}

//解析配置文件
object ConfigHepler {
  private lazy val config: Config = ConfigFactory.load()
  // 原始文件所在路径
  val bz2path = config.getString("dmp.bz2.path")

  // parquet文件输出路径
  val parquetPath = config.getString("dmp.parquet.path")


    // Kryo序列化包路径

  val serializer: String = config.getString("spark.serializer")

  /*// 解析MySQl相关配置参数
  val url: String = config.getString("db.default.url")
  val user: String = config.getString("db.default.user")
  val password: String = config.getString("db.default.password")
  val driver: String = config.getString("db.default.driver")
  val table: String = config.getString("db.default.table")*/

  //app字典路径
  val appdict: String = config.getString("app.dict.path")

//用sparksql写数据库
val url="jdbc:mysql://127.0.0.1:3306/wjy1?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&autoReconnect=true&failOverReadOnly=false&useSSL=true"
  val table="t_report_app_fenxi"
  val tableredis="t_report_app_fenxi_redis"
  val conn: Properties = new Properties()
  conn.setProperty("usr","wjy1")
  conn.setProperty("password","351991")
  conn.setProperty("driver","com.mysql.jdbc.Driver")


    // 解析redis的配置

  val redisHost: String = config.getString("db.redis.host")
  val redisPort = config.getInt("db.redis.port")
  //redis连接池相关参数设置
  val redisSetMaxTotal=config.getInt("redispool.maxtotal")  //设置最大连接量
  val redisSetMaxIdle=config.getInt("redispool.maxidle")     //支持最大的空闲连接
  val redisKu=config.getInt("db.redis.ku")

}
